home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
TURB_VIS
/
RESDMP11
/
RESDUMP.DOC
< prev
next >
Wrap
Text File
|
1993-07-28
|
5KB
|
145 lines
RESDMP11.ZIP -- RESDUMP Utility Vs 1.1 (July 1993)
==================================================
For TURBO PASCAL 7.0 and TURBO Vision 2.0.
Do you use resource files to store menu bars, status lines,
string lists and dialogs with subviews ? Do you need a nice little
resource dumper to document the contents of your resource file
(including 8-bit ASCII charts of your dialogs) ?
Well, here it is: RESDUMP.
RESDUMP handles
TMenubar, TStringlists, TStatusline and
TDialog with subviews
TView, TButton, TRadioButton, TCheckBoxes, TListViewer,
TListBox, TSortedListBox, TInputLine, TLabel, THistory,
TStaticText, TParamText
RESDUMP (file name RESDMP11.ZIP) consists of
Main program : RESDUMP.PAS
Units : RESDUTIL.PAS, DRESFU.PAS,
Resource file : RESDUMP.BRS
Readme file : RESDUMP.DOC
Test resource file : TESTBOX.BRS
Test resource program : TESTBOX.PAS
Test output file : TESTBOX.OUT
On invocation RESDUMP looks for the resource file in the same
directory where RESDUMP.EXE is found.
See the utility unit RESDUTIL.PAS for copyright text.
RESDUMP.PAS is just the frame, the real work is done in DRESFU.PAS.
Inspect this file how to incorporate your favorite objects.
This is easy if the derived object uses virtually the same
draw method as, and, hence, looks much like its ancestor.
DRESFU.PAS is somewhat boring; I added object after object as
I stumbled over them and hence this unit grew to its present size.
I use the resource editor RESEDIT Vs. 2.0 of Blaise Computing Inc.
with TStatusLine objects added by an self-hacked utility.
Missing features:
Dump subviews entered directly into the resource file not as part
of a TDialog object.
Problems:
Program cannot correctly clear the heap, if unregistered
objects are encountered inside TDialog objects. Sort of a
memory leak. It is not clear to me how TV handles this
situation. If there is an unregistered object inside a
TDialog, TV doesn't know how to load this thing and
apparently stops with loading any other subviews.
This explains why sometimes you get nearly a complete
TDialog sometimes not. It depends on the position of
the unregistered subview in the sequence of all subviews.
All the program can do is to report the number of the
unregistered object and to continue.
How to implement derived subviews of TDialog:
General outline:
1. Register your new object FOO in the main body of RESDUMP.PAS
2.-4. Changes in procedure ProcessDialogB in unit DRESFU.PAS:
2. Write a procedure WriteFOO to handle the actual output
for FOO (compare the many other WriteXXX procedures on
how to do that). This is not necessary if FOO differs
from its ancestor only by some methods (except the draw
method). See below.
3. Add a function CheckFOO (compare other CheckXXX functions)
4. Add a block of code like this (compare the other blocks
in ProcessDialogB)
IF DB^.FirstThat(@CheckFOO)<>NIL THEN
BEGIN
...
DB^.ForEach(@WriteFOO);
...
END;
Special case handling:
If the only difference between a derived object and its
ancestor are overridden methods there isn't much to do:
For instance, consider a TDerivedInputLine object with
overridden HandleEvent, Valid methods.
Make these changes to procedure ProcessDialogB in DRESFU.PAS
- Write a function CheckDerivedInputLine in analogy to
CheckInputLine
- Enter this block of code behind its InputLine counterpart
IF DB^.FirstThat(@CheckDerivedInputLine)<>NIL THEN
BEGIN
ownlabel := 0;
writeln ( outfile, ' [TDerivedInputLine]');
writeln ( outfile );
writeln ( outfile,
' Z: Origin Size hcxxx Options AMaxLen Label History' );
DB^.ForEach(@WriteInputLine);
writeln ( outfile, ' ---------------------');
writeln ( outfile );
END;
Browse the WriteInputLine procedure. This is a good example
to start with. There are a lot of nice procedures like
Hex, PutBar, PutHatch, PutShadow, PutFrame, TrimText, WrapText,
InsertStaticText, that will do most of what you need. The
Origin/Size mechanism is somewhat unclean but I'm too lazy
to streamline this in the future.
Further development is not intended but ... who knows.
History
-------
Vs. 1.0 First version
Vs. 1.1 Bug fixes, minor enhancements, better TDialog charts,
better stream management (in case of unregistered objects),
links between subviews,
-------------------------------------------------------------------
Dr. W. Gross, Dept. of Exp. Surgery, Univ. of Heidelberg, Germany
gross@aecds.exchi.uni-heidelberg.de
-------------------------------------------------------------------